package com.jsle.financial.manager;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.jsle.financial.dao.FileDao;
import com.jsle.financial.domain.DocPublish;
import com.jsle.financial.util.Constants;
import com.jsle.financial.vo.Result;

public class DocManagerImpl implements DocManager{
	private Log log = LogFactory.getLog(DocManager.class);
	@Resource
	private FileDao fileDao;
	public Result saveDoc(DocPublish doc){
		Result result = new Result();
		try {
			result = fileDao.saveDoc(doc);
		} catch (Exception e) {
			result.setResultCode(Constants.Manager.FC_RESULT_INSERT_TRANSACTIONAL_ERROR_CODE);
			result.setResultMessage(String.format(Constants.Manager.FC_RESULT_INSERT_TRANSACTIONAL_ERROR_MESSAGE, "User"));
			log.error("saveDoc error## "+ e.getMessage());
		}
		return result;
	}
	public FileDao getFileDao() {
		return fileDao;
	}
	public void setFileDao(FileDao fileDao) {
		this.fileDao = fileDao;
	}
}
